<?php

class Zend_View_Helper_EmbedVideo extends Zend_View_Helper_Abstract
{
    /**
     * View helper to embed youtube videos
     *
     * @param string $videoId   Id of YouTube video
     * @param int $width        Width of the frame
     * @param int $height       Height of the frame
     * @return string           Voiid string if $videoId=NULL
     */
    public function embedVideo($videoId, $width = 420, $height = 315)
    {
        $html = "";
        if (NULL !== $videoId) {
            $html = '<div class="prepend-2"><iframe width="';
            $html .= $width;
            $html .= '" height="';
            $html .= $height;
            $html .= '" src="http://www.youtube.com/embed/';
            $html .= $videoId;
            $html .= '" frameborder="0" allowfullscreen></iframe></div>';
        }
        return $html;
    }
    
}